{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 131,
   "source": [
    "import pandas as pd"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 加载数据"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "source": [
    "male_df = pd.read_excel('./data/18级高一体测成绩汇总.xls',engine='xlrd')\r\n",
    "female_df = pd.read_excel('./data/18级高一体测成绩汇总.xls',engine='xlrd',sheet_name=1)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 加载多层索引数据"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "source": [
    "score_df = pd.read_excel('./data/体侧成绩评分表.xls',engine='xlrd',sheet_name=0,header=[0,1])"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "### 类型转换"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "source": [
    "import re\r\n",
    "import six\r\n",
    "time_reg = re.compile(r\"(?P<minute>\\d*)'?(?P<second>\\d.)?\\\"?\")\r\n",
    "def convert_time(x):\r\n",
    "    if not isinstance(x,(six.string_types,)):\r\n",
    "        return float(x)\r\n",
    "    if not (x and x.strip()):\r\n",
    "        return None\r\n",
    "    _x = x.strip()\r\n",
    "    match = re.match(time_reg,_x)\r\n",
    "    if not match:\r\n",
    "        return None\r\n",
    "    match = match.groupdict()\r\n",
    "    minute = match.get('minute','0')\r\n",
    "    minute = int(minute) if minute else 0\r\n",
    "    second = match.get('second','0')\r\n",
    "    second = int(second) if second else 0\r\n",
    "    return round(minute+second/60,2)\r\n"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "#### 转换男1000米跑的时间"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "source": [
    "male_df.loc[:, \"男1000米跑\"] = male_df[\"男1000米跑\"].map(convert_time)\r\n",
    "score_df.loc[:, ('男1000米跑','成绩')]=score_df[('男1000米跑','成绩')].map(convert_time)\r\n",
    "score_df.loc[:, ('女800米跑','成绩')]=score_df[('女800米跑','成绩')].map(convert_time)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "#### 转换其他类型为float"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "source": [
    "number_reg = re.compile(r'\\d+\\.?\\d*')\r\n",
    "male_df = male_df.applymap(lambda x: float(x) if isinstance(x,(six.string_types)) and re.match(number_reg, x) else x)\r\n",
    "female_df = female_df.applymap(lambda x: float(x) if isinstance(x,(six.string_types)) and re.match(number_reg, x) else x)\r\n",
    "score_df = score_df.applymap(lambda x: float(x) if isinstance(x,(six.string_types)) and re.match(number_reg, x) else x)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "#### 计算BMI"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "source": [
    "male_df.loc[:,'BMI'] = round(male_df['体重'] / (male_df['身高']/100)**2,2)\r\n",
    "female_df.loc[:,'BMI'] = round(female_df['体重'] / (female_df['身高']/100)**2,2)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "#### 对体测成绩进行分数转换"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "source": [
    "def change_to_score(x):\r\n",
    "    column_name = x.name\r\n",
    "    if column_name not in score_df.columns:\r\n",
    "        return x\r\n",
    "    reverse_lable = False if \"米跑\" in column_name else True\r\n",
    "    _df = score_df[column_name]\r\n",
    "    _df = _df.dropna()\r\n",
    "    bins = _df[\"成绩\"].sort_values(ascending=True).values.tolist()\r\n",
    "    bins = [-999] + bins + [99999]\r\n",
    "    labels = _df[\"分数\"].sort_values(ascending=reverse_lable).values.tolist()\r\n",
    "    if not reverse_lable:\r\n",
    "        labels = labels[0:1] + labels\r\n",
    "    else:\r\n",
    "        labels = labels + labels[-1:]\r\n",
    "    x[x == 0] = None\r\n",
    "    result = pd.cut(x, bins=bins, labels=labels, ordered=False, right=reverse_lable)\r\n",
    "    return result"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "##### 转换男生成绩"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "source": [
    "cc = [i for i, j in score_df.columns]\r\n",
    "columns = [i for i in male_df.columns if i in cc]\r\n",
    "score = male_df[columns].apply(change_to_score)\r\n",
    "male_df = pd.merge(male_df, score, left_index=True, right_index=True, suffixes=(\"\", \"成绩\"))\r\n",
    "male_df"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男50米跑成绩</th>\n",
       "      <th>男跳远成绩</th>\n",
       "      <th>男体前屈成绩</th>\n",
       "      <th>男引体成绩</th>\n",
       "      <th>男肺活量成绩</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.22</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>2785</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.12</td>\n",
       "      <td>74</td>\n",
       "      <td>68</td>\n",
       "      <td>60</td>\n",
       "      <td>76</td>\n",
       "      <td>10</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.27</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11</td>\n",
       "      <td>7</td>\n",
       "      <td>3133</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.41</td>\n",
       "      <td>72</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>76</td>\n",
       "      <td>60</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.15</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>3901</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.28</td>\n",
       "      <td>76</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>80</td>\n",
       "      <td>10</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.35</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>4946</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.80</td>\n",
       "      <td>70</td>\n",
       "      <td>76</td>\n",
       "      <td>66</td>\n",
       "      <td>78</td>\n",
       "      <td>10</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.73</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13</td>\n",
       "      <td>9</td>\n",
       "      <td>3538</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.71</td>\n",
       "      <td>90</td>\n",
       "      <td>80</td>\n",
       "      <td>68</td>\n",
       "      <td>78</td>\n",
       "      <td>68</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.38</td>\n",
       "      <td>8.27</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>4647</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>22.44</td>\n",
       "      <td>70</td>\n",
       "      <td>74</td>\n",
       "      <td>68</td>\n",
       "      <td>74</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>473</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.32</td>\n",
       "      <td>9.55</td>\n",
       "      <td>210.0</td>\n",
       "      <td>15</td>\n",
       "      <td>6</td>\n",
       "      <td>7042</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>24.26</td>\n",
       "      <td>50</td>\n",
       "      <td>60</td>\n",
       "      <td>68</td>\n",
       "      <td>80</td>\n",
       "      <td>50</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>474</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3.42</td>\n",
       "      <td>7.50</td>\n",
       "      <td>252.0</td>\n",
       "      <td>13</td>\n",
       "      <td>13</td>\n",
       "      <td>5755</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>19.84</td>\n",
       "      <td>100</td>\n",
       "      <td>80</td>\n",
       "      <td>95</td>\n",
       "      <td>78</td>\n",
       "      <td>85</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.65</td>\n",
       "      <td>7.81</td>\n",
       "      <td>208.0</td>\n",
       "      <td>14</td>\n",
       "      <td>11</td>\n",
       "      <td>5688</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>17.48</td>\n",
       "      <td>64</td>\n",
       "      <td>78</td>\n",
       "      <td>68</td>\n",
       "      <td>80</td>\n",
       "      <td>76</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>477 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  男1000米跑  男50米跑    男跳远  男体前屈  男引体  男肺活量     身高    体重    BMI  \\\n",
       "0     1  男     4.22   8.88  195.0    12    1  2785  170.0  72.6  25.12   \n",
       "1     1  男     4.27   7.70  225.0    11    7  3133  174.0  52.7  17.41   \n",
       "2     1  男     4.15   8.45  218.0    14    1  3901  169.0  46.5  16.28   \n",
       "3     1  男     4.35   8.05  206.0    13    1  4946  183.0  79.7  23.80   \n",
       "4     1  男     3.73   7.52  210.0    13    9  3538  171.0  54.7  18.71   \n",
       "..   .. ..      ...    ...    ...   ...  ...   ...    ...   ...    ...   \n",
       "472  17  男     4.38   8.27  208.0    10    0  4647  176.0  69.5  22.44   \n",
       "473  17  男     5.32   9.55  210.0    15    6  7042  177.0  76.0  24.26   \n",
       "474  17  男     3.42   7.50  252.0    13   13  5755  181.0  65.0  19.84   \n",
       "475  17  男     4.65   7.81  208.0    14   11  5688  172.0  51.7  17.48   \n",
       "476  17  男     0.00   0.00    0.0     0    0     0    0.0   0.0    NaN   \n",
       "\n",
       "    男1000米跑成绩 男50米跑成绩 男跳远成绩 男体前屈成绩 男引体成绩 男肺活量成绩  \n",
       "0          74      68    60     76    10     64  \n",
       "1          72      78    76     76    60     70  \n",
       "2          76      72    72     80    10     85  \n",
       "3          70      76    66     78    10    100  \n",
       "4          90      80    68     78    68     76  \n",
       "..        ...     ...   ...    ...   ...    ...  \n",
       "472        70      74    68     74   NaN    100  \n",
       "473        50      60    68     80    50    100  \n",
       "474       100      80    95     78    85    100  \n",
       "475        64      78    68     80    76    100  \n",
       "476       NaN     NaN   NaN    NaN   NaN    NaN  \n",
       "\n",
       "[477 rows x 17 columns]"
      ]
     },
     "metadata": {},
     "execution_count": 139
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "source": [
    "##### 转换女生成绩"
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "source": [
    "cc = [i for i, j in score_df.columns]\r\n",
    "columns = [i for i in female_df.columns if i in cc]\r\n",
    "score = female_df[columns].apply(change_to_score)\r\n",
    "female_df = pd.merge(female_df, score, left_index=True, right_index=True, suffixes=(\"\", \"成绩\"))\r\n",
    "female_df"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "      <th>女800米跑成绩</th>\n",
       "      <th>女50米跑成绩</th>\n",
       "      <th>女跳远成绩</th>\n",
       "      <th>女体前屈成绩</th>\n",
       "      <th>女仰卧成绩</th>\n",
       "      <th>女肺活量成绩</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.31</td>\n",
       "      <td>100</td>\n",
       "      <td>74</td>\n",
       "      <td>85</td>\n",
       "      <td>78</td>\n",
       "      <td>90</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.07</td>\n",
       "      <td>62</td>\n",
       "      <td>20</td>\n",
       "      <td>60</td>\n",
       "      <td>68</td>\n",
       "      <td>66</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>24.34</td>\n",
       "      <td>100</td>\n",
       "      <td>10</td>\n",
       "      <td>62</td>\n",
       "      <td>64</td>\n",
       "      <td>78</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.80</td>\n",
       "      <td>100</td>\n",
       "      <td>72</td>\n",
       "      <td>76</td>\n",
       "      <td>95</td>\n",
       "      <td>85</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.91</td>\n",
       "      <td>100</td>\n",
       "      <td>70</td>\n",
       "      <td>60</td>\n",
       "      <td>66</td>\n",
       "      <td>72</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>9.60</td>\n",
       "      <td>150.0</td>\n",
       "      <td>24</td>\n",
       "      <td>41</td>\n",
       "      <td>2255</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>19.63</td>\n",
       "      <td>95</td>\n",
       "      <td>70</td>\n",
       "      <td>62</td>\n",
       "      <td>100</td>\n",
       "      <td>78</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.00</td>\n",
       "      <td>10.18</td>\n",
       "      <td>150.0</td>\n",
       "      <td>13</td>\n",
       "      <td>36</td>\n",
       "      <td>2937</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>21.49</td>\n",
       "      <td>76</td>\n",
       "      <td>66</td>\n",
       "      <td>62</td>\n",
       "      <td>74</td>\n",
       "      <td>74</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>10.18</td>\n",
       "      <td>152.0</td>\n",
       "      <td>15</td>\n",
       "      <td>35</td>\n",
       "      <td>2592</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>17.85</td>\n",
       "      <td>100</td>\n",
       "      <td>66</td>\n",
       "      <td>64</td>\n",
       "      <td>78</td>\n",
       "      <td>72</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.01</td>\n",
       "      <td>9.67</td>\n",
       "      <td>165.0</td>\n",
       "      <td>10</td>\n",
       "      <td>41</td>\n",
       "      <td>1829</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>18.38</td>\n",
       "      <td>76</td>\n",
       "      <td>70</td>\n",
       "      <td>72</td>\n",
       "      <td>70</td>\n",
       "      <td>78</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.48</td>\n",
       "      <td>9.09</td>\n",
       "      <td>180.0</td>\n",
       "      <td>10</td>\n",
       "      <td>46</td>\n",
       "      <td>2962</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>21.07</td>\n",
       "      <td>66</td>\n",
       "      <td>76</td>\n",
       "      <td>85</td>\n",
       "      <td>70</td>\n",
       "      <td>85</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重    BMI  \\\n",
       "0     1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3  19.31   \n",
       "1     1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6  25.07   \n",
       "2     1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0  24.34   \n",
       "3     1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7  19.80   \n",
       "4     1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9  22.91   \n",
       "..   .. ..     ...    ...    ...   ...  ...   ...    ...   ...    ...   \n",
       "588  17  女    3.51   9.60  150.0    24   41  2255  158.0  49.0  19.63   \n",
       "589  17  女    4.00  10.18  150.0    13   36  2937  161.0  55.7  21.49   \n",
       "590  17  女    3.45  10.18  152.0    15   35  2592  165.0  48.6  17.85   \n",
       "591  17  女    4.01   9.67  165.0    10   41  1829  154.0  43.6  18.38   \n",
       "592  17  女    4.48   9.09  180.0    10   46  2962  162.0  55.3  21.07   \n",
       "\n",
       "    女800米跑成绩 女50米跑成绩 女跳远成绩 女体前屈成绩 女仰卧成绩 女肺活量成绩  \n",
       "0        100      74    85     78    90    100  \n",
       "1         62      20    60     68    66    100  \n",
       "2        100      10    62     64    78    100  \n",
       "3        100      72    76     95    85    100  \n",
       "4        100      70    60     66    72    100  \n",
       "..       ...     ...   ...    ...   ...    ...  \n",
       "588       95      70    62    100    78     72  \n",
       "589       76      66    62     74    74     90  \n",
       "590      100      66    64     78    72     78  \n",
       "591       76      70    72     70    78     62  \n",
       "592       66      76    85     70    85     90  \n",
       "\n",
       "[593 rows x 17 columns]"
      ]
     },
     "metadata": {},
     "execution_count": 140
    }
   ],
   "metadata": {}
  }
 ],
 "metadata": {
  "orig_nbformat": 4,
  "language_info": {
   "name": "python",
   "version": "3.8.11",
   "mimetype": "text/x-python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "pygments_lexer": "ipython3",
   "nbconvert_exporter": "python",
   "file_extension": ".py"
  },
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.8.11 64-bit"
  },
  "interpreter": {
   "hash": "88c4a1b83521bb67c2a704a59fd8d4fbc808906c2f39c8cdcdb8c42e25302470"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}